import { http } from "@/utils"
import { ChannelRes, DetailDataType, ListParams, ListRes, ResType } from "./type"

export function fetchChannelAPI() {
    return http.request<ResType<ChannelRes>>({
        url: '/channels'
    })
}

export function fetchListAPI(params: ListParams) {
    return http.request<ResType<ListRes>>({
        url: '/articles',
        params
    })
}

export function fetchDetailAPI(article_id: string) {
    return http.request<ResType<DetailDataType>>({
        url: `/articles/${article_id}`,
    })
}